//
//  main.m
//  Demo0015
//
//  Created by zTercel on 13-1-14.
//  Copyright (c) 2013年 zTercel. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PhoneItem.h"
#import "PhoneBook.h"

int main(int argc, const char * argv[])
{
    @autoreleasepool {
        PhoneBook* book  = [[PhoneBook alloc] init];
        
        
        PhoneItem* phoneItem1   = [[PhoneItem alloc] initWithPhone: @"ztercel" phoneNumber: @"137-1460-1620"];
        PhoneItem* phoneItem2   = [[PhoneItem alloc] init];
        [phoneItem2 setName:@"ytercel"];
        [phoneItem2 setNumber:@"159-1984-7054"];
        
        [book addPhone:phoneItem1];
        [book addPhone:phoneItem2];
        [book addPhone:[PhoneItem createWithPhone:@"malili" phoneNumber:@"131-1249-2385"]];
        [book addPhone:[PhoneItem createWithPhone:@"lilei" phoneNumber:@"137-1243-2905"]];
        [book addPhone:[PhoneItem createWithPhone:@"hanmeimei" phoneNumber:@"133-1349-2455"]];
        [book addPhone:[PhoneItem createWithPhone:@"hanmeimei" phoneNumber:@"159-1129-2349"]];
        [book addPhone:[PhoneItem createWithPhone:@"malili" phoneNumber:@"131-1249-2312"]];

        [book queryPhone:@"hanmeimei"];

        [book description];  // 排序前
        [book sort];
        [book description];  // 排序后
        
        [book removePhone:@"malili"];
        [book description];
        
        
               
        
    }
    return 0;
}

